<?php 
 
$v_username = "";
if(isset($_REQUEST['txt_username'])){
	$v_username = _replace_bad_char($_REQUEST['txt_username']);
}
$v_question = "";
if(isset($_REQUEST['hdn_question'])){
	$v_question = _replace_bad_char($_REQUEST['hdn_question']);
}
$v_answer = "";
if(isset($_REQUEST['txt_answer'])){
	$v_answer = _replace_bad_char($_REQUEST['txt_answer']);
}

if(_is_sqlserver()){
	//Cap nhat noi dung cau hoi
	$sql = "Exec Onegate_VerifySecurity " ;
	$sql = $sql . "'" . $v_username . "'"  ;
	$sql = $sql . ",'" . $v_question . "'" ;
	$sql = $sql . ",'" . $v_answer . "'" ;
	//echo $sql; exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$rs = $ado_conn->GetRow($sql); 
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}
sleep(0);
if (!is_null($v_error) && $v_error<>""){?>
	<script>
		alert("<?php echo $v_error; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<?php echo $v_goto_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?php
	exit;
}
?>